package com.mapull.example.section1;

/**
 * 字符串 大小写转换
 *
 * @author mapull
 * @date 2021-08-25
 * @since 1.0
 **/
public class StringUpperLowerCase {
    public static void main(String[] args) {
        int times = 350;
        for (int i = 0; i < times; i++) {
            char ch = (char) i;
            for (int j = 0; j < times; j++) {
                if (i != j) {
                    char ch2 = (char) j;
                    if (ch2 != ch) {
                        boolean b1 = Character.toUpperCase(ch) == Character.toUpperCase(ch2);
                        boolean b2 = Character.toLowerCase(ch) == Character.toLowerCase(ch2);
                        if (b1 && !b2) {
                            System.out.print("大写相同: " + i + " and " + j + ", ");
                            System.out.println("Ch1=" + ch + " Ch2=" + ch2);
                        } else if (b2 && !b1) {
                            System.out.print("小写相同: " + i + " and " + j + ", ");
                            System.out.println("Ch1=" + ch + " Ch2=" + ch2);
                        }
                    }
                }
            }
        }
    }
}
